/**
 * 
 */
package com.sys.console.common.base;

import java.io.Serializable;

/**
 * @author zxp
 *
 */
public interface BaseService <T extends Serializable, PK extends Serializable>{
	
	
	/**
	 * 根据主键查询信息
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public abstract T queryByPrimaryKey(PK id) throws Exception;
	
	/**
	 * 保存或者更新数据
	 * @param entity
	 * @return
	 * @throws Exception
	 */
	public abstract int saveOrUpdate(T entity) throws Exception;
	
	/**
	 * 状态删除
	 * @param id
	 * @return
	 */
	public abstract int remove(PK id)throws Exception;
	
	/**
	 * 物理删除
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public abstract int delete(PK id)throws Exception;
	
	public abstract int updateStatus(T entity) throws Exception;
	
	public abstract int updateStatus(String status, String[] ids) throws Exception;


}
